﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;

namespace IEWebSite
{
    public partial class ActivitateDidactica : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
			if (Request.QueryString["ciclu"] == null || Request.QueryString["an"] == null) throw (new Exception());

			String Ciclu = "";
			using (SqlConnection sqlConn = Utils.GetSqlConnection())
			{
				sqlConn.Open();
				SqlCommand sqlComm = new SqlCommand("SELECT Ciclu FROM SysCiclu WHERE IdSysCiclu = @IdSysCiclu",sqlConn);
				SqlParameter sqlParam = new SqlParameter("IdSysCiclu",SqlDbType.Int,4);
				sqlParam.Value = Int32.Parse(Request.QueryString["ciclu"]);
				sqlComm.Parameters.Add(sqlParam);
				Ciclu = sqlComm.ExecuteScalar().ToString();
				
				sqlConn.Close();
			}

			litTitle.Text = Ciclu + " - Anul " + Request.QueryString["an"];
        }
    }
}
